<ul class="nav nav-tabs">
	<li ng-class="{'active':pagedata.op=='installed'}"><a href="javascript:;" ng-click="access('installed')">小程序列表</a></li>
</ul>
<div id="base_template_html" ng-init="func.get_url()">
	<div class="panel panel-default form-horizontal">
		<div class="panel-heading">自助上传小程序（{{pagedata.message}}）</div>
		<div class="panel-body">
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">小程序名称</label>
				<div class="col-sm-8">
					<input type="text" class="form-control " ng-model="pagedata.item.title" ng-readonly="true" />
					<div class="help-block"></div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">小程序模版id</label>
				<div class="col-sm-8">
					<input type="text" class="form-control " ng-model="pagedata.item.template_id" />
					<div class="help-block">自助上传成功后，登陆微信开放平台。将新上传的小程序加入模版库，获得模版id，填至此处</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 left-label">授权二维码</label>
				<div class="col-sm-8">
					<div class="input-group" style="margin-top:.5em;">
						<img ng-src="{{tomedia(pagedata.sq_url) || '../core/resource/images/nopic.jpg'}}" class="img-responsive img-thumbnail" width="150" />
					</div>
					<div class="help-block">系统会将获取到的授权二维码显示在此处，显示后请及时扫码授权</div>		
				</div>
			</div>
		</div>
	</div>
	<div class="form-group col-jy-12">
		<button  class="btn btn-primary" ng-click="post(pagedata.item,pagedata.post)">提交</button>
	</div>
</div>
<script>
window.scope.func.get_url=function(){
	window.scope.pagedata.message='授权二维码申请中...';
	window.scope.post({'id':window.scope.pagedata.item.cloud_id},'get_url','',function(res){
		if(res=='busy'){
			window.scope.message('服务器繁忙，请稍后再试！');
			window.scope.pagedata.message='服务器繁忙！';
		}else{
			window.scope.pagedata.sq_url=res;
		}
	});
}
</script>